/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.logiclander.adhocracy.jira.cli;

import com.atlassian.jira.rest.client.domain.Project;
import com.logiclander.adhocracy.cli.CommandLineReactor;

/**
 *
 * @author tim
 */
public class JiraShowProjectReactor implements CommandLineReactor {

    private boolean initialized = false;
    final Project project;

    public JiraShowProjectReactor(Project p) {
        project = p;
    }
    
    public void init() {
        initialized = true;
        System.out.println("----------------------------------------------------------------------");
        System.out.println("-- ProjectSummary                                                   --");
        System.out.println("----------------------------------------------------------------------");
    }

    public void process() {
        System.out.println("        key: " + project.getKey());
        System.out.println("description: " + project.getDescription());
        System.out.println("       lead: " + project.getLead().getName());
        System.out.println("----------------------------------------------------------------------");
    }

    public void destroy() {
        initialized = false;
    }
    
}
